// 统一对错误码进行处理
module.exports = (err, ctx) => {
    let status = 200;
    switch (err.code) {
        case '10001':
            status = 400;
            break;
        case '10002':
            status = 400;
            break;
        case '10003':
            status = 400;
            break;
        default:
            status = 200;
            break
    }
    // 记录日志信息
    console.error(err, ctx.request.body);
    ctx.status = status;
    ctx.body = err;
};